<template>
	<view>
	  <image src="../../static/img/party.png" class="img-c"></image>
	  <uni-list>
	  		<!-- title、note设置标题和小文字 -->
	  		<uni-list-item direction="row" v-for="item in info" :key="item.id" :title="item.title" :note="item.user_name + ' '+item.last_modify_date" @click="link(item)" link>
	  			<!-- 通过v-slot:header插槽定义列表左侧的图片显示，其他内容通过List组件内置属性实现-->
	  			<template v-slot:header>
	  				<!-- 当前判断长度只为简单判断类型，实际业务中，根据逻辑直接渲染即可 -->
	  				<image class="image-1" :src="item.avatar" mode="aspectFill"></image>
	  			</template>
	  		</uni-list-item>
	  </uni-list>
	</view>

</template>

<script>
	export default {
		components(){

		},
		data() {
			return {
				info: [
					{
						"user_name": "新华网",
						"title": "二十大新闻中心第四场记者招待会",
						"avatar": "http://www.news.cn/titlepic/112907/1129072256_1666238093912_title0h.jpg",
						"last_modify_date": "2022-10-20 11:41:58",
						"linkUrl":"http://www.news.cn/politics/cpc20/zb/jzh15183/index.htm"
					},
					{
						"user_name": "新华网",
						"title": "心声与掌声——聆听党的二十大报告",
						"avatar": "http://www.news.cn/politics/cpc20/2022-10/20/1129071726_16662011573731n.jpg",
						"last_modify_date": "2022-10-20 01:58:04",
						"linkUrl":"http://www.news.cn/politics/cpc20/2022-10/20/c_1129071726.htm"
					},
					{
						"user_name": "新华网",
						"title": "这是人类发展史上真正的奇迹”——国际社会热议中国式现代化的世界意义",
						"avatar": "http://www.news.cn/politics/cpc20/2022-10/19/1129071539_16662013793081n.png",
						"last_modify_date": "2022-10-19 22:56:38",
						"linkUrl":"http://www.news.cn/politics/cpc20/2022-10/19/c_1129071539.htm"
					}, {
						"user_name": "新华网",
						"title": "二十大故事 | 张桂梅代表的新梦想",
						"avatar": "http://www.news.cn/politics/cpc20/2022-10/19/1129071532_16661960688991n.jpg",
						"last_modify_date": "2022-10-19 22:46:28",
						"linkUrl":"http://www.news.cn/politics/cpc20/2022-10/19/c_1129071532.htm"
					},
					{
						"user_name": "新华网",
						"title": "为如期实现建军一百年奋斗目标砥砺奋进——全军官兵认真收听收看党的二十大开幕会并展开学习讨论",
						"avatar": "http://www.news.cn/politics/cpc20/2022-10/19/1129070124_16661161878031n.jpg",
						"last_modify_date": "2022-10-19 00:49:18 ",
						"linkUrl":"http://www.news.cn/politics/cpc20/2022-10/19/c_1129070124.htm"
					},
					{
						"user_name": "央视新闻",
						"title": "党的二十大报告，号召我们这样团结奋斗",
						"avatar": "http://cpc.people.com.cn/mediafile/pic/BIG/20221017/40/1118395186090311256.jpg",
						"last_modify_date": "2022-10-17 12:55:13",
						"linkUrl":"http://cpc.people.com.cn/20th/n1/2022/1017/c448334-32546693.html"
					}
				]
			}
		},
		onLoad() {

		},
		methods: {
            link(item){
				let linkUrl=item.linkUrl
				window.location.href = linkUrl
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.image-1 {
		flex-shrink: 0;
		margin-right: 10px;
		width: 125px;
		height: 125px;
		border-radius: 6px;
		overflow: hidden;
		border: 1px #f5f5f5 solid;
	}
	.img-c{
		width: 100%;
	}
</style>